<template>
  <div class="main ub ub-ver">
    <NavBar title="我的图片" />
    <div class="utabs ub ub-ac">
      <div v-for="(item,index) in ['本地图片', '网络图片']" :key="index" class="item ub-f1 ub ub-ver ub-ac" :class="{'on': curTab===index}" @click="switchTab(index)">
        <div class="txt tx-c">{{ item }}</div>
        <div class="line" />
      </div>
    </div>
    <div v-if="dataList.length > 0" class="content ub-f1">
      <div v-for="(item, index) in dataList" :key="index" class="itit">
        <div class="cell ub ub-ac">
          <div class="tit ub-f1">{{ item.billDate }}</div>
          <div class="tag">已审核</div>
        </div>
        <div class="cell ub ub-ac">
          <div class="tit">客户：{{ item.name }} 仓库：{{ item.name }}</div>
        </div>
        <div class="cell ub ub-ac">
          <div class="tit">地址: {{ item.name }}</div>
          <div class="ub-f1 tx-r">物流：{{ item.count }}</div>
        </div>
      </div>
    </div>
    <div v-else class="content ub-f1 ub ub-ver ub-ac ub-pc">
      <image class="nodataImg" src="../../static/null/null3.png" mode="widthFix" />
      <div class="nodataTxt">暂无图片</div>
    </div>
  </div>
</template>
<script>
import service from '@/utils/http'
import constant from '@/utils/constant'
import { errDialog, loading, toPage } from '@/utils/util'
export default {
  data() {
    return {
      curTab: 0,
      dataList: [],
      toPage
    }
  },
  onReady() {
    this.getData()
  },
  methods: {
    getData() {
      service.get('/api/userGoods/list').then(res => {
        this.dataList0 = res.data.list || []
        this.dataList0.forEach(it => {
          it.pImg = it.pic.split(',')[0]
        })
      })
      service.get('/api/userCollects/list').then(res => {
        this.dataList1 = res.data.list || []
      })
    },
    toPageByParam(url, type) {
      uni.setStorageSync('actType', type)
      toPage(url)
    },
    switchTab(index) {
      this.dataList = []
      this.curTab = index
    }
  }
}
</script>
<style scoped>
.main {
  position: relative;
  width: 100%;
  height: 100%;
}
.content{
  border-radius: 16rpx 16rpx 0 0;
  background: #ffffff;
  overflow: hidden;
  position: relative;
  z-index: 1;
  padding: 0 20rpx;
  overflow: auto;
}
.tag {
  padding: 2upx 10upx;
  background-color: #5499ff;
  color: #fff;
  border-radius: 4px;
  font-size: 24upx;
}
.content {
  margin-top: 10rpx;
}
.cell {
  height: 64upx;
}
.tit {
  font-size: 28upx;
  color: #333;
  margin-right: 20upx;
}
.itit {
  padding: 10upx 20upx;
  background: #fff;
}
.itit + .itit{
  border-top: 1rpx #f1f1f1 solid;
}

</style>
